import org.kwis.msp.lcdui.Jlet;
import org.kwis.msp.lcdui.Display;

import org.kwis.msp.lwc.Component;
import org.kwis.msp.lwc.FormComponent;
import org.kwis.msp.lwc.ShellComponent   ;
import org.kwis.msp.lwc.DialogComponent  ;
import org.kwis.msp.lwc.LabelComponent   ;

public class DialogComponentEx1 extends Jlet{

	Display displayLCD ;
	ShellComponent shell;	
	FormComponent form;

	public DialogComponentEx1(){  
		displayLCD = Display.getDefaultDisplay();
		shell = new ShellComponent();
		form = new FormComponent();
	}

	protected void startApp(String[] arg0){
		
		displayLCD = Display.getDefaultDisplay();

		shell.setTitle("DialogComponent");

		DialogComponent dialog = new DialogComponent(new LabelComponent("저장할까요?"),"File 저장",DialogComponent.TYPE_OK_CANCEL);
		LabelComponent label = new LabelComponent("test");
		form.addComponent(label);
		form.addComponent(dialog);
		shell.setWorkComponent(form);

		//int diaValue = dialog.doModal();

		if(diaValue==DialogComponent.DLG_OK){
			shell.setWorkComponent(new LabelComponent("저장했습니다."));
			diaValue=dialog.doModal();
		}


		displayLCD.pushCard(shell.getCard());

		
	}
	protected void destroyApp(boolean arg0) {  }

	

}
